1. Field of the Invention
The present invention relates to a synchronous processing method and apparatus for a plurality of processors, and more particularly, to a method and apparatus in which a plurality of processors execute a plurality of programs in parallel and in synchronism.
2. Description of the Related Art
In recent years, with demands for increases both in speed and in capacity of a computer system, there has been developed a distributed processing technology for distributing processes to a plurality of processors. For example, in a multiprocessor system in which a multiplicity of processors are connected, the respective processors execute processes in parallel. In this multiprocessor system, the respective processors communicate with each other via a communications unit, operate in parallel and execute a certain batch process on the whole. According to this multiprocessor system, one job can be processed at a higher speed.
Furthermore, in the multiprocessor system, the individual processors for effecting the parallel processing have to execute processes containing a plurality of phases in some cases. This synchronous processing is conducted by the following actions. To start with, the processor which has finished its processing the earliest detects that a synchronous waiting status is reached, and waits for an end of the processing by another processor before synchronization begins. Namely, this processor waits until all other processors reach the synchronous waiting status, so that the processors may become synchronized. Then, upon detecting that all the processors have reached the synchronous waiting status, all the processors execute the synchronization process discussed below.
Synchronous processing is conducted by a synchronous processing element provided in each processor. This synchronous processing element includes a synchronous status register, a synchronous receiving element and a synchronous detecting element. At the first onset, the processor which has finished its processing earliest sets, in its synchronous status register, a piece of synchronous status information (e.g., "1") indicating that the processor has reached the synchronous waiting status. Then, this synchronous status information is transmitted via a communication unit to all other processors. The synchronous status information is set in the synchronous receiving elements in all other processors. Next, the processors which have finished their processings set the synchronous status information in their own synchronous status register. This synchronous status information is transmitted to all other processors. Further, the transmitted synchronous status information is set in the synchronous receiving elements in all of the other processors. Subsequently, the processor which has terminated its processing last sets the synchronous status information in its status register. This synchronous status information is then transmitted to the synchronous receiving elements in all other processors. At this point, the synchronous detecting element in each processor detects all of the synchronous status information, corresponding to the number of processors, which have been received in the synchronous receiving element. Then, the processors shift to the next processing on the assumption that all the processors are now synchronized.
The conventional synchronous processing element includes a synchronous status register, a synchronous receiving element and a synchronous detecting element, each containing only the data "1". Therefore, only one process (one program) can be executed by one processor. Further, the conventional synchronous processing element is incapable of assigning a certain program to one group of processors to be synchronized among the group of processors and assigning another program to a second group of processors to be synchronized among the second group. For this reason, it is impossible to execute, with high efficiency, a plurality of parallel processing programs.